﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace OtherDevice
{
    [Description("OPT-DPA2024E-8")]
    public class OPT_DPA2024E:LightCtrlBase
    {
        public OPT_DPA2024E(string strName) : base(strName)
        {
            controlFrom = new XNCLightCtrl();
        }

        public override int Get(int channel)
        {
            return 0;
        }
        public override bool Set(int channel, int value)
        {
            try
            {
                byte[] byteArray = new byte[6];
                byteArray[0] = 0xFF;
                byteArray[1] = 0x01;
                byteArray[2] = (byte)(channel & 0X00FF);
                byteArray[3] = (byte)((value & 0XFF00) >> 8);
                byteArray[4] = (byte)(value & 0X00FF);
                byteArray[5] = 0x00;
                byte[] S =new byte[2];
                return SendAndReciveData(byteArray, ref S, 500);
            }
                catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show($"光源设置失败{ex}");
                return false;
            }
        }

    }
}